#ifndef _HAL_MD_H_
#define _HAL_MD_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "hal_struct.h"

typedef enum {
    HAL_MD_ALARM_TYPE = 7,
} HAL_MDALARM_TYPE_E;

typedef struct {
    HAL_MDALARM_TYPE_E eAlarmType; /* 移动侦测报警类型。 */
    int32_t alarmState;            /* 报警状态值。1：有报警；0：无报警。*/
    char *pAlarmFileName;      /* 保留。*/
} HAL_MDALARM_S;

typedef int32_t (*HalMdAlarmCallbackFuncPtr)(int32_t channel, HAL_MDALARM_S *pstMdAlarm, void *pUserArg);

typedef enum {
    HAL_MD_ALARM_LEVEL_1 = 1,
    HAL_MD_ALARM_LEVEL_2,
    HAL_MD_ALARM_LEVEL_3,
    HAL_MD_ALARM_LEVEL_4,
    HAL_MD_ALARM_LEVEL_5,
    HAL_MD_ALARM_LEVEL_6,
    HAL_MD_ALARM_LEVEL_MAX,
} HAL_MDALARM_LEVEL_E;

typedef struct {
    int32_t bEnabled;                  /* 移动侦测使能开关。1：使能；0：关闭。*/
    uint32_t x;                         /* 移动侦测区域起始横坐标 */
    uint32_t y;                         /* 移动侦测区域起始纵坐标 */
    uint32_t w;                         /* 移动侦测区域宽 */
    uint32_t h;                         /* 移动侦测区域高 */
    HAL_MDALARM_LEVEL_E eMdAlarmlevel; /* 移动侦测灵敏度等级。值越大越灵敏。*/
} HAL_MDALARM_PARAM_S;

/**
typedef enum
{
    HAL_BD_ALARM_LEVEL_1 = 1,
    HAL_BD_ALARM_LEVEL_2,
    HAL_BD_ALARM_LEVEL_3,
    HAL_BD_ALARM_LEVEL_4,
    HAL_BD_ALARM_LEVEL_5,
    HAL_BD_ALARM_LEVEL_6,
    HAL_BD_ALARM_LEVEL_MAX,
} HAL_BDALARM_LEVEL_E;

typedef struct
{
    HAL_S32 bEnabled;                    	// 视频遮挡使能开关。1：使能；0：关闭。
    HAL_BDALARM_LEVEL_E eBdAlarmLevel;  	// 视频遮挡灵敏度等级。值越大越灵敏。
} HAL_BDALARM_PARAM_S;

typedef struct
{
    HAL_S32 state;   // 视频遮挡状态。1：有遮挡；0：无遮挡。
} HAL_BD_RESULT_S;

typedef HAL_S32(*DspSdkBdGetResultFuncPtr)(HAL_VOID *pUserArg, HAL_BD_RESULT_S *pstBdRes);
*/

int32_t Hal_MD_create(int32_t channel, HalMdAlarmCallbackFuncPtr pCallbackFuncPtr, void *pCallbackArg);

int32_t Hal_MD_setParam(int32_t channel, uint32_t regionId, const HAL_MDALARM_PARAM_S *pstMdParam);

int32_t Hal_MD_getParam(int32_t channel, uint32_t regionId, HAL_MDALARM_PARAM_S *pstMdParam);

int32_t Hal_MD_destroy(int32_t channel);

#ifdef __cplusplus
}
#endif

#endif // _IPC_SDK_HAL_MD_H_
